package com.jrx.anytxn.transaction.job.waiveAutoPayment.step;

import com.jrx.anytxn.transaction.entity.AmWaiveRepaymentPlanInfo;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 贴息还款批扣准备reader
 *
 * @author : zhenghaopu
 * 2019/11/22
 */
public class WaiveAutoPaymentPreReader extends MyBatisPagingItemReader<AmWaiveRepaymentPlanInfo> {


    public WaiveAutoPaymentPreReader(Date bussinessDate, SqlSessionFactory sqlSessionFactory, Integer pagesize){
        setSaveState(false);
        setPageSize(pagesize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.transaction.mapper.ext.ExtAmWaiveRepaymentPlanInfoMapper.selectAllForBatch");
        Map<String, Object> map = new HashMap<>();
        map.put("paymentDueDate", bussinessDate);
        setParameterValues(map);
    }
}
